package com.dtb.trade.util;

import com.dtb.trade.entity.mongodb.first.FirstBlock;
import com.dtb.trade.entity.mongodb.fourth.FourthBlock;
import com.dtb.trade.entity.mongodb.second.SecondBlock;
import com.dtb.trade.entity.mongodb.third.ThirdBlock;

/**
 * @Author:ChengJian
 * @Description:
 * @Date: Created in 下午5:55 2018/8/21
 */
public class ConvertUtil {

    public static SecondBlock convertSecond(FirstBlock firstBlock){

        SecondBlock block = new SecondBlock();
        block.setData(firstBlock.getData());
        block.setHash(firstBlock.getHash());
        block.setIndex(firstBlock.getIndex());
        block.setNonce(firstBlock.getNonce());
        block.setPreviousHash(firstBlock.getPreviousHash());
        block.setTimestamp(firstBlock.getTimestamp());
        block.setPointDeals(firstBlock.getPointDeals());
        return block;
    }

    public static ThirdBlock convertThird(FirstBlock firstBlock){


        ThirdBlock block = new ThirdBlock();
        block.setData(firstBlock.getData());
        block.setHash(firstBlock.getHash());
        block.setIndex(firstBlock.getIndex());
        block.setNonce(firstBlock.getNonce());
        block.setPreviousHash(firstBlock.getPreviousHash());
        block.setTimestamp(firstBlock.getTimestamp());
        block.setPointDeals(firstBlock.getPointDeals());
        return block;
    }

    public static FourthBlock convertFourth(FirstBlock firstBlock){

        FourthBlock block = new FourthBlock();

        block.setData(firstBlock.getData());
        block.setHash(firstBlock.getHash());
        block.setIndex(firstBlock.getIndex());
        block.setNonce(firstBlock.getNonce());
        block.setPreviousHash(firstBlock.getPreviousHash());
        block.setTimestamp(firstBlock.getTimestamp());
        block.setPointDeals(firstBlock.getPointDeals());
        return block;

    }




}
